package cn.net.wanji.entity;

import cn.net.wanji.enums.CargoColour;
import cn.net.wanji.utils.StringUtils;
import lombok.Data;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author guodejun
 * @createTime 2022/11/1 13:19
 * @description
 */
@Data
public class VehicleRsuInfo extends ExitVehicleRsuInfo {

    private String recordId;
    private String recordType;
    private String erId;

    private String unlawfulMold;
    private String hourBatchNo;

    private Integer driveDir;
    private String devType;

    private String headPicTime;
    private String sidePicTime;
    private String tailPicTime;

    private String headLaneNum;
    private String sideLaneNum;
    private String tailLaneNum;
    private String licenseCode;
    private String licenseAbbre;

    private String licenseColor;
    private Integer vehicleSpeed;
    private Integer identifyType;
    private Integer vehicleLength;
    private Integer vehicleWidth;
    private Integer vehicleHeight;
    private Integer vehicleAxleCount;

    private String vehicleAxleInfo;

    private String dangerousGoods;
    private String compositeImage;
    private String headImage;
    private String licenseImage;
    private String sideImage;
    private String tailImage;
    private String video;

    private String etcMediaType;
    private String etcMac;
    private String etcContractSerial;

    private String etcTransTime;
    private String etcTradeResult;
    private String etcLicense;
    private String etcLicenseColor;
    private String etcVehClass;
    private String etcVehUserType;
    private String etcStatus;
    private String etcValidSign;
    private String etcEntryClass;
    private String etcEntryAxles;
    private String etcEntryTime;
    private String etcGeneralState;
    private String etcTollStation;

    private String vehTradeResult;
    private String relateEtcCount;

    private String relateEtcMediaType;
    private String relateEtcMac;
    private String relateEtcContractSerial;
    private String confidenceDegree;
    private String specialClass;
    private String exitTime;
    private String entryTime;
    private String updateTime;
    private String detectTime;
    private String etcPassId;
    private String relateEtcPassId;
    private String etcDevType;
    private String relateEtcEntryTime;
    private String relateEtcTradeResult;
    private String cLaserProofId;
    private String cLaserAssistFlag;
    //新增
    private String tailLicenseCode;
    private String tailLicenseColor;
    private String vehBodyColor;
    private String tailVehBodyColor;
    private String relateEtcTransTime;
    private String relateEtcLicense;
    private String relateEtcLicenseColor;
    private String relateEtcVehClass;
    private String relateEtcVehUserType;
    private String relateEtcEntryClass;
    private String relateEtcEntryAxles;

    // etc 核载人数
    private Integer etcApprovalNumber;
    //趟次id
    private String vehicleDepotRecordId;
    //分公司名称
    private String branchCode;
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
//    public LocalDateTime getDetectTimeAsLocalDateTime() {
////        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        if (!StringUtils.isEmpty(detectTime) && detectTime.contains(".")) {
//            return LocalDateTime.parse(detectTime,formatter1);
//        }else{
//            return LocalDateTime.parse(detectTime,formatter);
//        }
//    }
    // 示例方法：根据枚举类型值获取枚举实例
    public CargoColour getCargoType(int value) {
        for (CargoColour type : CargoColour.values()) {
            if (type.getValue() == value) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid cargo type value: " + value);
    }

}
